home *** CD-ROM | disk | FTP | other *** search
-
-
-
- Search(V1.3)
-
-
- NAME
- Search - Search a file or files for a name or pattern.
-
- SYNOPSIS
- 1.3:
- Search [From name] [Search string] ALL [NONUM] [QUIET]
- [QUICK] [FILE]
-
- 2.x/3.x:
- Search [From name] [Search string] ALL [NONUM] [QUIET]
- [QUICK] [FILE] [PATTERN]
-
- DESCRIPTION
- Use Search to hunt for patterns or strings in files.
- As usual, you can specify the files using a wildcard
- pattern, and you can also specify a directory to be
- searched. Search also allows itself to be used in the
- middle of a pipeline. To do this, you must use the
- filename STDIN, and it must be spelled in UPPER CASE.
-
- Under 2.x/3.x's Search also allows you to specify a
- wildcard pattern as the search string, which the 1.3
- version still does not. Any valid AmigaDOS pattern may
- be used as the search string.
-
- If a search object is found, then Search will return
- 0, otherwise it will return with the WARN faillevel set.
- This makes Search usable in scripts (see also QUIET,
- below).
-
- When searching through more than one file at a time,
- you can use C-e or C-f (Control E or Control F) to
- abandon the current file and move on to the next. (NOTE:
- This is different from the Commodore BCPL search, which
- uses C-d (Control d). Using C-e and C-f prevents
- conflicts with using C-d in script files, since C-d will
- abort a script file.) As usual, to kill the program, use
- C-c (Control C).
-
- Search treats the carriage return character as the
- end of the line. It also only searches the first 205
- characters of a line, if there are more characters than
- that then the you are warned with a 'LINE n truncated' (n
- being the line number) and the search continuing.
-
- 2.x/3.x's Search places the last pattern you used in
- an environment variable called "Search". If you reuse
- Search at a later time, and omit the search string,
- Search will use the value of this Environment variable.
- This is convenient when searching for complex patterns
- over and over again on different disks or directories.
- This is also available to other programs to use if
- desired.
-
- KEYWORDS
- ALL
- Recursively descend all directories in the specified
- branch of the directory tree, searching each file for the
- pattern specified.
-
- NONUM
- Do not display line numbers. This option will also
- kill the indent Search usually adds to the lines it
- displays. Not used before 1.3.
-
- FROM name
- The file or directory to be searched. 'name' can also
- be an AmigaDOS pattern if using 2.x/3.x. If this is the
- first argument in your SEARCH, then this keyword is
- optional.
-
- SEARCH or NAME string
- This is the string of text you will look for. If this
- is your second argument then the keyword is optional. if
- there are any spaces in your string, there must be quotes
- around it. The string is not case sensitive, so if you
- search for HIM then him, Him, HiM, or hIm, etc. Under
- 2.x/3.x you can use NAME instead of SEARCH and the exact
- same result will occur.
-
- QUIET
- Search without displaying found lines. This is
- useful when you only want to get the return code from
- Search (for example, in a script file).
-
- QUICK
- This causes Search to use a more compact output
- format to speed up display. NOTE - when using SEARCH
- from an interactive CLI, this is the DEFAULT.
-
- FILE
- This causes Search to hunt for a file of the
- specified name, rather than searching through the
- contents of the files. Under 2.x/3.x the full path is
- printed. This makes it extremely easy to find a
- particular file on a large volume.
-
- CASE
- This causes Search to consider case as important in
- comparing search patterns. Ordinarily, case is ignored
- during a search.
-
- PATTERN
- An optional keyword under 2.x/3.x only. It tells the
- CLI that a pattern will be used during the search.
-
-
- EXAMPLES
-
- 1.This command line demonstrates the use of wildcard
- patterns in both the FROM and the SEARCH string positions.
- This will cause Search to look at all files in
- SYS:INCLUDE/exec which end with the characters '#?.h', for
- all strings which begin with the three characters 'SIG',
- followed by any character, followed by an underscore,
- followed by anything:
-
-
-
- Search SYS:INCLUDE/exec/#?.h SIG?_#?
-
-
-
- 2.To Search all the files in a directory called Westerns/TNT
- and all the files within its subdirectories for the phrase
- 'speghetti westerns':
-
-
- Search Westerns/TNT "speghetti westerns' ALL
-
-
- 3.Look inside the file AmigaJokes for the work IrvingGould:
-
-
- Search AmigaJokes IrvingGould
-
-
- 4.Search Quickly all the files which end in .txt in the
- current dir for the phrase 'super model' and print them.
-
-
- Search > PRT: #?.txt "super models" QUICK
-
-
-